<br>
<div class="panel panel-default shadowed">
    <div class="panel-heading clearfix">
        <h2 class="panel-title pull-left">Customers</h2>
        <div class="pull-right">
            <form class="form">
                <input type="text" class="form-control" ng-model="cc.searchCustomer" placeholder="Search...">
            </form>
        </div>
        <div class="pull-right">
            <button type="button" class="btn btn-primary" ng-click="cc.editCustomer(undefined)"><span class="fa fa-plus"></span> Customer</button>
        </div>
    </div>
    <div class="panel-body">
        <table class="table table-hover table-mouse-hover">
            <thead>
            <tr>
                <th>Name</th>
                <th>Address</th>
                <th>Contact Person</th>
                <th>Phone Number</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="customer in cc.customers | filter: cc.searchCustomer" ng-click="cc.editCustomer(customer)">
                <td>{{customer.name}}</td>
                <td>{{customer.address}}</td>
                <td>{{customer.contact_person}}</td>
                <td>{{customer.phone_number}}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<script type="text/ng-template" id="editCustomer">
    <div class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="editCustomerLabel">Edit Customer</h4>
                </div>
                <div class="modal-body">
                    <form role="form">
                        <div class="row">
                            <div class="form-group col-md-6">
                                <label for="name">Name</label>
                                <input type="text" ng-model="ecc.customer.name" class="form-control" id="name">
                            </div>
                            <div class="form-group col-md-6">
                                <label for="address">Address</label>
                                <input type="text" ng-model="ecc.customer.address" class="form-control" id="address">
                            </div>
                            <div class="form-group col-md-6">
                                <label for="contact">Contact Person</label>
                                <input type="text" ng-model="ecc.customer.contact_person" class="form-control" id="contact">
                            </div>
                            <div class="form-group col-md-6">
                                <label for="phone">Phone Number</label>
                                <input type="text" ng-model="ecc.customer.phone_number" class="form-control" id="phone">
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-warning" data-dismiss="modal" ng-click="ecc.close('none')">
                        <span class="fa fa-close"></span> Cancel
                    </button>
                    <button type="button" class="btn btn-success" data-dismiss="modal" ng-click="ecc.close('update')" ng-show="ecc.isDeleteAllowed()">
                        <span class="fa fa-check"></span> Update Customer
                    </button>
                    <button type="button" class="btn btn-success" data-dismiss="modal" ng-click="ecc.close('add')" ng-show="!ecc.isDeleteAllowed()">
                        <span class="fa fa-check"></span> Add Customer
                    </button>
                    <button type="button" class="btn btn-danger" data-dismiss="modal" ng-click="ecc.close('delete')" ng-show="ecc.isDeleteAllowed()">
                        <span class="fa fa-trash"></span> Delete Customer
                    </button>
                </div>
            </div>
        </div>
    </div>
</script>